#include <string.h>
#include <stdio.h>
#include <stdlib.h>

#include "hq_aes.h"
#include "base64.h"

#define MAX_KEY 512
#define KEY "key.txt"

unsigned char key[MAX_KEY];
unsigned char *iv = NULL;

static void initKey() {
    b64_decodef(KEY, "tmpkey");
    FILE *fp = fopen("tmpkey", "r");
    fread(key, 1, MAX_KEY, fp);
    fclose(fp);
}

static void add_info(char* path) {
}

int main(int argc, char **argv) {
    if (argc != 3) {
        printf("AES DEC PARAMS ERR!\n");
        return -1;
    }

    system("rm -f tmp tmpkey");
    initKey();

    b64_decodef(argv[1], "tmp");
    HqAesDecFile("tmp", key, NULL, "tmp");
    b64_encodef("tmp", argv[2]);

    add_info(argv[2]);
}
